<?php defined('SYSPATH') or die('No direct script access.');
/**
 * Helper untuk source code
 * @author petra.barus
 */
class source_Core {

    private static $ar_sourcetypes = array(
        '.pas' => 'pascal',
        '.pp' => 'pascal',
        '.c' => 'c',
        '.cpp' => 'c++',
        '.java' => 'java',
    );

    /**
     * Return source type
     * @param   string  source path
     * @return  string  source type
     */
    public static function type($path)
    {
        $type = strrchr($path, '.');
        if (!array_key_exists($type, self::$ar_sourcetypes))
        return "unknown";
        return self::$ar_sourcetypes[$type];
    }
}
//end of file